package top.yueyazhui.learn_shiro.service.impl;

import org.apache.shiro.authz.annotation.RequiresRoles;
import org.apache.shiro.authz.annotation.RequiresUser;
import org.springframework.stereotype.Service;
import top.yueyazhui.learn_shiro.service.HelloService;

@Service
public class HelloServiceImpl implements HelloService {

    @Override
    @RequiresUser // 登录之后就可以访问；无论是 Realm 认证登录，还是 RememberMe 认证登录
//    @RequiresAuthentication // Realm 认证登录可以访问，RememberMe 认证登录不能访问
    public String hello() {
        return "Hello Shiro";
    }

    @Override
    @RequiresRoles("admin")
    public String admin() {
        return "Hello Admin";
    }
}
